<template>
  <div>
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media" v-for="(item,index) in newslist" :key="index">
        <router-link :to="'/Home/newsInfo/'+item.id">
          <img class="mui-media-object mui-pull-left" :src="item.img_url" />
          <div class="mui-media-body">
            {{item.title}}
            <p class="mui-ellipsis">
                <span>发表时间: {{item.add_time | deteFoemat}}</span>
                <span class="last">点击次数: {{item.click}}</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
    data(){
        return {
            newslist: []
        }
    },
    created(){
        this.newsList()
    },
    methods:{
        newsList(){
            this.axios.get("api/getnewslist").then(res=>{
                console.log(res.data.message);
                this.newslist=res.data.message
            })
        }
    }
};
</script>

<style lang="less" scoped>
    .mui-ellipsis{
        font-size: 13px;
        color: greenyellow;
        .last{
           float: right;
        }
    }
</style>